Skip to content

Post-merge-review: Fix template-no-invalid-link-title: track @ember/routing LinkTo import#2674

Merged
NullVoxPopuli merged 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-no-invalid-link-title
Apr 13, 2026
Merged

Post-merge-review: Fix template-no-invalid-link-title: track @ember/routing LinkTo import#2674
NullVoxPopuli merged 1 commit intoember-cli:masterfrom
johanrd:night_fix/template-no-invalid-link-title

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

What's broken on master

Flags <LinkTo> in all files. In GJS/GTS strict mode, LinkTo only refers to Ember's router link when explicitly imported from @ember/routing. A user-authored component named LinkTo is falsely flagged.

Fix

Track ImportDeclaration from @ember/routing, matching the pattern in template-no-invalid-link-text.

Test plan

47/47 tests pass. 1 new GJS valid test (unimported <LinkTo>) fails on master.


Co-written by Claude.

…t in GJS/GTS

The rule flagged <LinkTo> in all files, but in GJS/GTS strict mode LinkTo
only refers to Ember's router link when explicitly imported from
'@ember/routing'. A user-authored component named LinkTo would be
incorrectly flagged. Adds ImportDeclaration tracking matching the pattern
already used in template-no-invalid-link-text.
@johanrd johanrd marked this pull request as ready for review April 13, 2026 10:33
if (!isStrictMode) {
return;
}
if (node.source.value === '@ember/routing') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could probably extract all this logic to a helper, too since it's seeming pretty common

@NullVoxPopuli NullVoxPopuli merged commit a1ab781 into ember-cli:master Apr 13, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants